home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / linuxcon.000 / linuxcon / linuxconf-1.6 / dialog / yesno.c < prev   
C/C++ Source or Header  |  1995-08-03  |  738b  |  35 lines

  1. #include "dialog.h"
  2.  
  3.  
  4. /*
  5.     Display a dialog box with two buttons - Yes and No
  6.     Return MENU_YES, MENU_NO or MENU_ESCAPE
  7. */
  8. MENU_STATUS dialog_yesno(
  9.     const char *title,
  10.     const char *prompt,
  11.     const char *helpfile)        /* path of a help text file */
  12.                                 /* or NULL */
  13. {
  14.     DIALOG dia;
  15.     int nof = 0;
  16.     return dia.edit (title,prompt,helpfile,nof,MENUBUT_YES|MENUBUT_NO);
  17. }
  18. #ifdef TEST
  19.  
  20. int main (int argc, char *argv[])
  21. {
  22.     MENU_STATUS ret1,ret2;
  23.     init_dialog();
  24.     ret1 = dialog_yesno("This is a test","Are you\nsure you want to exit\n"
  25.         ,NULL);
  26.     ret2 = dialog_yesno("This is a test","Are you\nsure you want to exit\n"
  27.         ,"/usr/lib/conf/askrunlevel/askrunlevel.help");
  28.     endwin();
  29.     printf ("ret1 = %d ret2 = %d\n",ret1,ret2);
  30.     return 0;
  31. }
  32.  
  33. #endif
  34.  
  35.